#ifndef __OLED_H
#define __OLED_H

#define OLED_RES_GPIO_Port GPIOA
#define OLED_RES_Pin GPIO_PIN_4

#define OLED_DC_GPIO_Port GPIOA
#define OLED_DC_Pin GPIO_PIN_3

#define OLED_CS_GPIO_Port GPIOA
#define OLED_CS_Pin GPIO_PIN_2

#define OLED_RES_Clr() HAL_GPIO_WritePin(OLED_RES_GPIO_Port,OLED_RES_Pin,GPIO_PIN_RESET)//RES
#define OLED_RES_Set() HAL_GPIO_WritePin(OLED_RES_GPIO_Port,OLED_RES_Pin,GPIO_PIN_SET)
 
#define OLED_DC_Clr() HAL_GPIO_WritePin(OLED_DC_GPIO_Port,OLED_DC_Pin,GPIO_PIN_RESET)//DC
#define OLED_DC_Set() HAL_GPIO_WritePin(OLED_DC_GPIO_Port,OLED_DC_Pin,GPIO_PIN_SET)
 		     
#define OLED_CS_Clr()  HAL_GPIO_WritePin(OLED_CS_GPIO_Port,OLED_CS_Pin,GPIO_PIN_RESET)//CS
#define OLED_CS_Set()  HAL_GPIO_WritePin(OLED_CS_GPIO_Port,OLED_CS_Pin,GPIO_PIN_SET)

extern SPI_HandleTypeDef hspi1;

void OLED_Init(void);
void OLED_Clear(void);
void OLED_ShowChar(uint8_t Line, uint8_t Column, char Char);
void OLED_ShowString(uint8_t Line, uint8_t Column, char *String);
void OLED_ShowFixedLengthNumber(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t Length);
void OLED_ShowSignedNum(uint8_t Line, uint8_t Column, int32_t Number, uint8_t Length);
void OLED_ShowHexNum(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t Length);
void OLED_ShowBinNum(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t Length);
void OLED_ShowLargeChar(uint8_t Line, uint8_t Column, uint8_t num);
void OLED_ShowLargeNum(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t Length);
void OLED_ShowNum(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t maxLength);
void OLED_ShowColon(uint8_t Line, uint8_t Column);
void OLED_ShowLocation(uint8_t Line, uint8_t Column,bool sign);
void OLED_ShowHeart(uint8_t Line, uint8_t Column, bool sign);
void OLED_ShowStepsOrKcal(uint8_t Line, uint8_t Column, bool sign);
void OLED_ShowSpO2(uint8_t Line, uint8_t Column);
void OLED_ShowSmallNum(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t Length);
void OLED_ShowFloat(uint8_t Line, uint8_t Column, float Number, uint8_t maxLength, uint8_t decimalPlaces);
void OLED_ShowExercise(uint8_t Line, uint8_t Column, uint8_t sign);
void OLED_ShowSleep(uint8_t Line, uint8_t Column);
void OLED_ShowSleepLight(uint8_t Line, uint8_t Column);
void OLED_ShowSleepDeep(uint8_t Line, uint8_t Column);
void OLED_ShowAwake(uint8_t Line, uint8_t Column);
#endif
